package com.gitee.wsl.markdown.html.tag
/*

import io.noties.markwon.base.MarkwonConfiguration
import io.noties.markwon.base.RenderProps
import io.noties.markwon.base.core.CoreProps
import io.noties.markwon.base.html.HtmlTag
import org.commonmark.node.Heading
import java.lang.NumberFormatException

class HeadingHandler : SimpleTagHandler() {
    override fun getSpans(
        configuration: MarkwonConfiguration,
        renderProps: RenderProps,
        tag: HtmlTag
    ): Any? {
        val factory = configuration.spansFactory()[Heading::class.java] ?: return null
        val level: Int = try {
            tag.name().substring(1).toInt()
        } catch (e: NumberFormatException) {
            e.printStackTrace()
            0
        }
        if (level < 1 || level > 6) {
            return null
        }
        CoreProps.HEADING_LEVEL[renderProps] = level
        return factory.getSpans(configuration, renderProps)
    }

    override fun supportedTags(): List<String> {
        return listOf("h1", "h2", "h3", "h4", "h5", "h6")
    }
}*/
